public class Chess {
	private Player player = null;
	private int x;
	private int y;

	public Chess(){
		
	}
	public Chess(Player p, String pos) {
		// convert position such as "A1" to coordinate (0,0)
		char c = pos.charAt(0);
		String str = (c + "").toUpperCase();
		x = str.charAt(0) - 'A';
		y = Integer.parseInt(pos.charAt(1) + "") - 1;
		player = p;
	}

	public String toString() {
		if (player == null)
			return ".";
		if (player == player.X_PLAYER)
			return "X";
		else
			return "O";
	}

	public int getX() {
		return x;
	}

	public int getY() {
		return y;
	}

	public Player getPlayer() {
		return player;
	}
}
